#include "filguid.h"
#include <tchar.h>
#include <dshow.h>

#define WM_MOUSEWHEEL 0x020A
#define WM_PRIV_NOTIFY WM_APP+1
#define ID_PLUGIN (WM_APP+2)
#define ID_EFFECT (WM_APP+200)
#define WM_GRAPHNOTIFY WM_USER+15
#define ID_TIME WM_USER+16
#define ID_EXTEFF (WM_APP+1000)





class AuSample{
public:
	//BYTE *samples;
	//int bps,nch,srate;
	//int numsamples;
	//int Seek;
public:
	virtual int open(int,int,int)=0;
	virtual int write(BYTE*,int,int,int,int)=0;
	virtual void close()=0;
	virtual void flush()=0;

};
class Audio:public AuSample{
public:
	int Enable;
public:
	Audio();
	int open(int,int,int);
	int write(BYTE*,int,int,int,int);
	void close();
	void flush();
};

/*typedef struct
{
	
	// dsp plug-in processing:
	// (filled in by winamp, called by input plug)

	int (*dsp_dosamples)();
	int (*dsp_isactive)();
	// eq stuff
	AuSample* (*GetData)(); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore.


} DspMod;
*/

DECLARE_INTERFACE_(IFilterInterface,IUnknown)
{

	STDMETHOD(SetOptions)(THIS_ int topt)PURE;
	STDMETHOD(SetSmooth)(THIS_ int topts)PURE;
	STDMETHOD(SetExtEff)(THIS_ int teopt)PURE;
	STDMETHOD(SetExtEff)(THIS_ char*fname)PURE;
	STDMETHOD(SetConfigure)(THIS_ HWND)PURE;
	STDMETHOD(SetStop)(THIS_)PURE;

};
DECLARE_INTERFACE_(IAuFilter,IUnknown)
{
	STDMETHOD(SetDspfunction)(THIS_ AuSample*)PURE;
	STDMETHOD(SetStop)(THIS_)PURE;
};


struct Info{
	HWND hwnd,hwndfull;
	char fn[MAX_PATH];
	OAHWND hwnddrain;
	POINT c1;
	BOOL flag;
	int CapHeight;
	int Xborder,Yborder;
	BOOL SkinMode,EffectEnable;
	HMENU hmenumain,hmenu,hmenueff,hmenuexteff;
	int NofSkin;
	char Path[MAX_PATH];
	BOOL FullScreen;
	BOOL Dspeffect;
	BOOL AspectRatio;
	HWND About;
	int uIntex,dIndex,Index,Smooth,Exteff,AutoSkin;
	HCURSOR hcur;
//	unsigned int AboutID;

}info;
struct SkinMenu
{
	char Path[MAX_PATH];
	DWORD Menuid;
}skm[150];
struct Graph
{
	IGraphBuilder *pGraph;
	IMediaControl *pMedia;
	IMediaPosition *pMediaPos;
	IVideoWindow *pVid;
	IBasicAudio *pBasicAudio;
	IBasicVideo *pBasicVideo;
	IBaseFilter *pFilter;
	IFilterInterface *pEffFilter;
	IMediaEventEx *pEvent;
	IBaseFilter *pAudioFilter;
	IAuFilter *pAudioInterface;
	IBaseFilter *pColorSpace;
	//IBaseFilter *pColorSpace1;

	
}gr;
struct Skin
{
	HBITMAP hbit;
	BITMAP bmp;
	HDC mhdc;

}sk[8];
void About(HWND);
void Init();
void Quit();
int IsOurFile(char *);
int Play(char*);
void Pause();
void UnPause();
int IsPaused();
void Stop();
int GetLength();
int GetOutputTime();
void SetOutputTime(int);
void SetVolume(int);
void SetPan(int);
void Release();
void InitPlay();
LRESULT CALLBACK Wndproc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam);
LRESULT CALLBACK Dlgproc(HWND,UINT,WPARAM,LPARAM);
BOOL CALLBACK Kannanproc(HWND,UINT,WPARAM,LPARAM);
BOOL CALLBACK Resumeprintproc(HWND,UINT,WPARAM,LPARAM);
BOOL CALLBACK Keyboardproc(HWND,UINT,WPARAM,LPARAM);
BOOL CALLBACK Historyproc(HWND,UINT,WPARAM,LPARAM);
void GetFileInfo(char *, char *, int *);
int infoDlg(char *, HWND);
void SetFileName(char*);
void ToggleFullScreen();
int LoadCustomSkin();
void InitSkinDir();
int ProcessSkinMenu(DWORD opt);
int GetFilterByName(REFCLSID clsid, char *FilterName, IBaseFilter **pIBasefilter);
void InitFilterMenu();
BOOL CALLBACK Resumeproc(HWND,UINT,WPARAM,LPARAM);
int dsp_dosamples();
int dsp_isactive();
int Paint(HWND);
int Registermainclass();
HRESULT RegisterDll(LPSTR szDll, bool bUnregister);
void CALLBACK OneShotTimer(UINT wTimerID, UINT msg, 
    DWORD dwUser, DWORD dw1, DWORD dw2);

